﻿#ifndef DATAINFO_H
#define DATAINFO_H

#include <QString>
#include <vector>
#include <functional>
#include <QMap>
#include <QList>
#include <array>

class QNetworkAccessManager;

#define URI "http://47.100.100.187:1080"

extern QNetworkAccessManager *g_httpManager;

extern int g_person_id;

extern bool g_isUpdateMessageInfo;

extern int g_iThreshold;

extern std::array<int, 4> g_sensorStatus;

extern QMap<int, std::function<void()> > g_mapIntToFunc;

class ProductInfo
{
public:
    ProductInfo() {}
    ~ProductInfo(){}

public:
    int id{-1};
    bool isEnable{false};
    QString strName;
    int normalCount{0};
    int otherCount{0};
    int slowCount{0};
    int stopCount{0};
};

extern std::vector<ProductInfo> g_vecProductInfo;
extern int g_iProductLineID;

class GateWay
{
public:
    GateWay() { }
    ~GateWay() { }

public:
    int id{-1};
    bool isEnable{false};
    QString strName;
};

extern std::vector<GateWay> g_vecGateWay;
extern int g_iGateWayID;

extern QString g_strGateStateInfo;
//extern int g_iGetSensorNum;

class Sensor
{
public:
    Sensor() {}
    ~Sensor() {}

public:
    int id{-1};
    QString cell_code;
    int data{-1};
    QString name;
    QString status;
};

extern QMap<int, QList<Sensor> > g_mapGroupIdToListSensor;

extern QPair<int, QString> g_httpReplayResult;

#endif // DATAINFO_H
